#include <Growl/Growl.h>

static CFTypeRef notifications[] = {
  CFSTR("test name")
};

int main(int argc, char *argv[]) {
  struct Growl_Delegate delegate;
  InitGrowlDelegate(&delegate);
  delegate.applicationName = CFSTR("gpyp3test");

  CFTypeRef keys[] = {
    GROWL_NOTIFICATIONS_ALL,
    GROWL_APP_ID
  };
  CFArrayRef allNotifications = CFArrayCreate(NULL,
                                              notifications,
                                              sizeof(notifications) / sizeof(notifications[0]),
                                              &kCFTypeArrayCallBacks);
  CFTypeRef values[] = {
    allNotifications,
    CFSTR("org.gpyp3")
  };
  CFDictionaryRef dict = CFDictionaryCreate(NULL,
                                            keys,
                                            values,
                                            sizeof(keys) / sizeof(CFTypeRef),
                                            &kCFTypeDictionaryKeyCallBacks,
                                            &kCFTypeDictionaryValueCallBacks);

  delegate.registrationDictionary = dict;
  Growl_SetDelegate(&delegate);
  CFRelease(allNotifications);

  /*
  Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext(CFSTR("title"),
                                                                     CFSTR("desc"),
                                                                     CFSTR("test name"),
                                                                     NULL, 0, false, NULL);
  */
  struct Growl_Notification n;
  InitGrowlNotification(&n);
  n.name        = CFSTR("test name");
  n.title       = CFSTR("title");
  n.description = CFSTR("desc");
  Growl_PostNotification(&n);
  return 0;
}
